package demo;

/**
 * @author wang'ji'cheng
 * @date 2025/7/15
 */
public class demo01 {
    public void method(){
        System.out.println("反射。。。");
    }

    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {

        //通过 Class.forName(全类名)获取Class字节码文件对象
        Class clazz = Class.forName("demo.Student");
        //第二种方式，通过类名.Class获取字节码文件对象
        Class<Student> clazz2 = Student.class;
        //第三种方法 通过创建对象.getClass获取字节码文件对象
        Student student = new Student();
        Class aClass = student.getClass();

        System.out.println(clazz2==clazz);
        System.out.println(clazz2==aClass);


    }


}
